/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.agi.devsol.ejb.requisito;

import br.com.agi.devsol.dominio.Requisito;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateful;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

/**
 *
 * @author rgrosz
 */
@Stateless
public class ListadorRequisitoImpl implements ListadorRequisito{

    @PersistenceContext 
    private EntityManager em;
    
    
    @Override
    public List <Requisito> findRequisitos(){
        CriteriaBuilder criteriaBuilder = em.getCriteriaBuilder();
        CriteriaQuery<Requisito> qQuery = criteriaBuilder.createQuery(Requisito.class);        
        TypedQuery<Requisito> tQuery = em.createQuery(qQuery);
        List<Requisito> retorno = tQuery.getResultList();
        return retorno;
    }
}
